package com.example.exchange.client.exchange;


import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@FeignClient(name = "weather-client", url = "${caiyun.host}/${caiyun.api-version}/${caiyun.token}")
public interface ExchangeClient {

  @RequestMapping(value = "/{location}/realtime", method = RequestMethod.GET)
  Object realtime(@PathVariable(name = "location", required = false) String location);

  @RequestMapping(value = "/{location}/minutely", method = RequestMethod.GET)
  Object minutely(@PathVariable(name = "location", required = false) String location);


  @RequestMapping(value = "/{location}/weather?alert=true&dailysteps={dailysteps}&hourlysteps={hourlysteps}", method = RequestMethod.GET)
  Object weather(@PathVariable(name = "location", required = false) String location,
                 @PathVariable(name = "dailysteps", required = false) Integer dailysteps,
                 @PathVariable(name = "hourlysteps", required = false) Integer hourlysteps);
}
